Skip to content

fix: load sessions created by other front-ends - #152

Merged
jkyberneees merged 2 commits into
mainfrom
fix/foreign-session-resume
Oct 9, 2026
Merged

jkyberneees merged 2 commits into
mainfrom
fix/foreign-session-resume

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Summary

Sessions created in the odek WebUI failed to load in bodek.

  • client: the WebUI keeps its session tokens in the browser, so bodek has none for those sessions. odek answers that detail request with a mint-only bootstrap (X-Session-Token header, {"session_id","bootstrapped":true}, no transcript), which bodek decoded as the session itself: resume replayed nothing, adopted an empty session id, and the turn errored. SessionDetail now refetches once with the minted token and returns an error instead of the stub. Every session path benefits (^R, --session, delete, pin, rename, export).
  • tui: odek stores prompts with attachments and @-resources inlined into content (wrapped in untrusted markers) and the typed text in principal_prompt. Replay rendered content, so resumed sessions showed raw wrappers and file bodies in the user's turn; it now shows the prompt as typed.

Testing

  • New tests: internal/client/foreign_session_test.go (bootstrap refetch, missing or refused minted token, known token in one request) and TestReplayPrincipalPrompt. The client tests fail without the fix.
  • make fmt, make vet, make lint (0 issues), make test (race) all green.
  • End-to-end against odek v2.33.3: a session created on another connection with an attachment and no shared token resumes with the correct id and transcript, replays the typed prompt without the attachment body, is adopted over the WebSocket, and a follow-up prompt answers from the original session's context.

🤖 Generated with Claude Code

jkyberneees and others added 2 commits October 9, 2026 07:30
A session the odek WebUI created has no token in bodek's store. odek
answers that detail request with a mint-only bootstrap (session token
header, {"session_id","bootstrapped":true}, no transcript), which bodek
decoded as the session: resume replayed nothing, adopted an empty id,
and the turn errored. SessionDetail now refetches once with the minted
token and reports an error instead of returning the stub.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
odek stores a prompt with attachments and @-resources expanded into
content, wrapped in untrusted markers, and the typed text in
principal_prompt. Replay rendered content, so resumed sessions showed
raw wrappers and file bodies in the user's turn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bodek 34a241d Commit Preview URL

Branch Preview URL
Oct 09 2026, 05:31 AM

@jkyberneees
jkyberneees merged commit 8b69383 into main Oct 9, 2026
9 checks passed
@jkyberneees
jkyberneees deleted the fix/foreign-session-resume branch October 9, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant